<!DOCTYPE html>
<html>
<head>
    <title>修改分组</title>
    <include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>
</head>
<body>
<form class="layui-form" action="" id="f">
	<input type="hidden" name="module" value="{$param.module}">
	<input type="hidden" name="sort" value="{$param.sort}">
	<table  class="layui-table layui-nomargin" >
		<tr>
			<td>模块名</td>
			<td>
				{$param.module}
			</td>
		</tr>
		<tr>
			<td width="20%">菜单名</td>
			<td>
				<input type="text" name="name" id="name" required  lay-verify="required" placeholder="菜单名" autocomplete="off" class="layui-input" value="{$info.name}">
			</td>
		</tr>
		<tr>
			<td>地址</td>
			<td>
				{$info.url}
			</td>
		</tr>
		<tr>
			<td>显示状态</td>
			<td>
			      <input type="hidden" name="is_show" value="2" >  
			      <input type="checkbox" name="is_show" lay-filter="change" lay-skin="switch" value="1" <php>if($info['is_show'] == 1){echo "checked='checked'";}</php> >  
			</td>
		</tr>
	</table>
</form>
	<include file='public/scripts'>
	<script type="text/javascript">
		function callbackdata(){
			let edit_url = "{:cmf_plugin_url('ModuleConfig://nav/edit')}";
			$.ajax({
                url:edit_url,
                type:"post",
                data:$('#f').serialize(),
                success:function(data){
                    if(data.type=='success'){
                        layer.msg(data.msg,{icon:1,time:1500},function(){
                            parent.layer.closeAll();
                            parent.window.location.reload();
                        });
                    }else if(data.type=='error'){
                        layer.msg(data.msg,{icon:2,time:1500});
                    }
                },
                error:function(data){
                    layer.msg('系统错误');
                    return false;
                }
            })    
		}
	</script>
</body>
</html>